//
import * as mvc from "common/mvc";
import * as dec from "common/decorator";
// ==========================================================================================
import * as dbtps from "../types";
/**
 * 库项目基类。
 */
export abstract class Item extends mvc.Model implements dbtps.IName {
    /**
     * 项目类型。
     */
    public itemType: dbtps.ItemType;
    /**
     * 库中选中状态。
     */
    @dec.addHistoryAndNotification(true, dbtps.MNotificationType.ItemSelect)
    @dec.getterSetter(true, true)
    public selected: boolean = false;
    /**
     * 项目名称。
     */
    @dec.addHistoryAndNotification(true, dbtps.MNotificationType.ItemNameChange)
    @dec.getterSetter(true, true)
    public name: string = "";
    /**
     * 项目文件夹。
     */
    @dec.addHistoryAndNotification(true, dbtps.MNotificationType.ItemParentChange)
    @dec.getterSetter(true, true)
    public parent: Folder | null = null;
}
/**
 * 库项目文件夹。
 */
export class Folder extends Item {
    /**
     * 库中打开状态。
     */
    public opened: boolean = false;
    public constructor() {
        super();

        this.itemType = dbtps.ItemType.Folder;
    }
}